﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DSA___semestralkaA___2
{
    public class Hrana<E, O> : IHrana<E, O> where E : IKlic
    {
        private E A;
        private E B;
        private O data;



        public Hrana(E a, E b)
        {
            this.A = a;
            this.B = b;
        }

        public Hrana(E a, E b, O ohodnoceni)
        {
            this.A = a;
            this.B = b;
            this.data = ohodnoceni;
        }




        public IKlic vratUzelA()
        {
            return ((IKlic)A);
        }
        public IKlic vratUzelB()
        {
            return ((IKlic)B);
        }

        public O vratOhodnoceni()
        {
            return data;
        }

        public override string ToString()
        {
            return vratUzelA().getX() + "|" + vratUzelA().getY() + "|" + vratUzelB().getX() + "|" + vratUzelB().getY() + "|" + vratOhodnoceni() + "\r\n";
        }



    }
}
